﻿using System;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using Microsoft.SqlServer.Server;
using System.IO;

public partial class UserDefinedFunctions
{
    [Microsoft.SqlServer.Server.SqlFunction]
    public static SqlXml ListarPersonal(string filtro)
    {
        SqlServerProject1.WebReference.wsgeneral ws = new SqlServerProject1.WebReference.wsgeneral();
        String xmlStr = ws.ListarPersonalDt(filtro);

        SqlXml objData;
        try
        {
            objData = new SqlXml(new System.Xml.XmlTextReader(xmlStr, System.Xml.XmlNodeType.Document, null));
        }
        catch
        {
            throw;
        }
        return objData;
    }

    [Microsoft.SqlServer.Server.SqlFunction]
    public static SqlXml PROC_LISTAR_CONTRATOS_SUSCR(String finicio, String ffin, String proveedor)
    {
        SqlServerProject1.WebReference.wsgeneral ws = new SqlServerProject1.WebReference.wsgeneral();
        String xmlStr = ws.PROC_LISTAR_CONTRATOS_SUSCR(finicio, ffin, proveedor);

        SqlXml objData;
        try
        {
            objData = new SqlXml(new System.Xml.XmlTextReader(xmlStr, System.Xml.XmlNodeType.Document, null));
        }
        catch
        {
            throw;
        }
        return objData;
    }

    [Microsoft.SqlServer.Server.SqlFunction]
    public static SqlXml PROC_LISTAR_REFRIG_SUSTITUIDAS(String finicio, String ffin, String marca, String filtroPor)
    {
        SqlServerProject1.WebReference.wsgeneral ws = new SqlServerProject1.WebReference.wsgeneral();
        String xmlStr = ws.PROC_LISTAR_REFRIG_SUSTITUIDAS(finicio, ffin, marca, filtroPor);

        SqlXml objData;
        try
        {
            objData = new SqlXml(new System.Xml.XmlTextReader(xmlStr, System.Xml.XmlNodeType.Document, null));
        }
        catch
        {
            throw;
        }
        return objData;
    }

    [Microsoft.SqlServer.Server.SqlFunction]
    public static SqlXml PROC_OBTENER_CARTERA_RENOVA(String secuencia, String tipoTarifa, String plazo)
    {
        SqlServerProject1.WebReference.wsgeneral ws = new SqlServerProject1.WebReference.wsgeneral();
        String xmlStr = ws.PROC_OBTENER_CARTERA_RENOVA(secuencia, tipoTarifa, plazo);

        SqlXml objData;
        try
        {
            objData = new SqlXml(new System.Xml.XmlTextReader(xmlStr, System.Xml.XmlNodeType.Document, null));
        }
        catch
        {
            throw;
        }
        return objData;
    }

    [Microsoft.SqlServer.Server.SqlFunction]
    public static SqlXml PROC_OBTENER_CARTERA_RENOVA_DET(String secuencia, String tipoTarifa, String plazo, String anio)
    {
        SqlServerProject1.WebReference.wsgeneral ws = new SqlServerProject1.WebReference.wsgeneral();
        String xmlStr = ws.PROC_OBTENER_CARTERA_RENOVA_DET(secuencia, tipoTarifa, plazo, anio);

        SqlXml objData;
        try
        {
            objData = new SqlXml(new System.Xml.XmlTextReader(xmlStr, System.Xml.XmlNodeType.Document, null));
        }
        catch
        {
            throw;
        }
        return objData;
    }

    [Microsoft.SqlServer.Server.SqlFunction]
    public static SqlXml PROC_RECAREME(String finicio, String ffin)
    {
        SqlServerProject1.WebReference.wsgeneral ws = new SqlServerProject1.WebReference.wsgeneral();
        String xmlStr = ws.PROC_RECAREME(finicio, ffin);

        SqlXml objData;
        try
        {
            objData = new SqlXml(new System.Xml.XmlTextReader(xmlStr, System.Xml.XmlNodeType.Document, null));
        }
        catch
        {
            throw;
        }
        return objData;
    }

    [Microsoft.SqlServer.Server.SqlFunction]
    public static SqlXml PROC_RECARENO(String finicio, String ffin)
    {
        SqlServerProject1.WebReference.wsgeneral ws = new SqlServerProject1.WebReference.wsgeneral();
        String xmlStr = ws.PROC_RECARENO(finicio, ffin);

        SqlXml objData;
        try
        {
            objData = new SqlXml(new System.Xml.XmlTextReader(xmlStr, System.Xml.XmlNodeType.Document, null));
        }
        catch
        {
            throw;
        }
        return objData;
    }

    [Microsoft.SqlServer.Server.SqlFunction]
    public static SqlXml PROC_PROCESOS_CARTERA_VENCIDA()
    {
        SqlServerProject1.WebReference.wsgeneral ws = new SqlServerProject1.WebReference.wsgeneral();
        String xmlStr = ws.PROC_PROCESOS_CARTERA_VENCIDA();

        SqlXml objData;
        try
        {
            objData = new SqlXml(new System.Xml.XmlTextReader(xmlStr, System.Xml.XmlNodeType.Document, null));
        }
        catch
        {
            throw;
        }
        return objData;
    }

    [Microsoft.SqlServer.Server.SqlFunction]
    public static SqlXml PROC_USUARIO_RENOVA()
    {
        SqlServerProject1.WebReference.wsgeneral ws = new SqlServerProject1.WebReference.wsgeneral();
        String xmlStr = ws.PROC_USUARIOS_RENOVA();

        SqlXml objData;
        try
        {
            objData = new SqlXml(new System.Xml.XmlTextReader(xmlStr, System.Xml.XmlNodeType.Document, null));
        }
        catch
        {
            throw;
        }
        return objData;
    }

    [Microsoft.SqlServer.Server.SqlFunction]
    public static SqlXml PROC_USUARIO_INTRANET()
    {
        SqlServerProject1.WebReference.wsgeneral ws = new SqlServerProject1.WebReference.wsgeneral();
        String xmlStr = ws.PROC_USUARIOS_INTRANET();

        SqlXml objData;
        try
        {
            objData = new SqlXml(new System.Xml.XmlTextReader(xmlStr, System.Xml.XmlNodeType.Document, null));
        }
        catch
        {
            throw;
        }
        return objData;
    }

    [Microsoft.SqlServer.Server.SqlFunction]
    public static SqlXml PROC_USUARIO_CGWEB()
    {
        SqlServerProject1.WebReference.wsgeneral ws = new SqlServerProject1.WebReference.wsgeneral();
        String xmlStr = ws.PROC_USUARIOS_CGWEB();

        SqlXml objData;
        try
        {
            objData = new SqlXml(new System.Xml.XmlTextReader(xmlStr, System.Xml.XmlNodeType.Document, null));
        }
        catch
        {
            throw;
        }
        return objData;
    }

};

